package extract.method;

/**
 * Created by Administrator on 2018/1/25.
 */
public class Test {

    private String name;

    //需要重构的代码
    void printOwing(double amount) {
        printBanner();

        //print details
        System.out.println("name:" + name);
        System.out.println("amount" + amount);
    }

    //重构后的代码
    void printOwingRF(double amount) {
        printBanner();
        printDetails(amount);
    }

    private void printDetails(double amount) {
        System.out.println("name:" + name);
        System.out.println("amount" + amount);
    }

    private void printBanner() {
        //code
    }

}
